<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="my" uri="http://amani.com/function-taglib"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品信息</title>
<%@ include file="../shared/common_header.jsp"%>
</head>
<body>
	<section id='shopItemDetails'>
		<header  style="overflow: hidden;" > 
		<img style="width:100%" src="${product.mainimageurl }" }>
			<div class='bar'>	
			<div class='productDescriptor'>
							<div class='productName'>${product.name}</div>
							<div class='productPrice'>￥${product.price}</div>
							<div class='productOrgPrice'>￥${product.originalcost}</div>
						</div> 
						</div>
		</header>
		<div class='content'>
			<div class='content-title'>产品详情</div>
			<div class='content-body'>
			 <c:if test="${fn:length(product.productDescriptions)>0  }">
		 		<c:forEach var="item" items="${product.productDescriptions }"> 
					<img style="width:100%" src="${item.imageurl }">
					<div>${item.imageDescription }</div>
				</c:forEach>
				</c:if>
			</div>
		</div>
		<div class="bar bar-standard bar-footer ">  
				<button class="btn btn-add-shoppingcart" value="${product.id}">加入购物车</button>
				<button class="btn btn-buy" value="${product.id}">立 即 购 买</button>
				<button class="btn btn-shoppingcart">购  物  车</button>
		</div>
	</section>
	<script type="text/javascript">
		$(function(){
			$(".btn-add-shoppingcart").bind("click",function(e){
				var productid=$(e.currentTarget).attr("value");
				window.location.href='${ROOT_PATH }Shop/ShoppingCart?addProductId='+productid;
			});
			$(".btn-buy").bind('click',function(e){
				var productid=$(e.currentTarget).attr("value");
				window.location.href='${ROOT_PATH }Shop/ShoppingCart?addProductId='+productid;
			})
			$(".btn-shoppingcart").bind('click',function(e){ 
				window.location.href='${ROOT_PATH }Shop/ShoppingCart';
			});
		})
	</script>
</body>
</html>